package cn.edu.gcu.lost.sys.entity;

import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonIgnore;

public class Menu extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @JsonIgnore
    private Menu parent;    // 父级菜单

    @JsonIgnore
    private String parentIds; // 所有父级编号

    @Length(min = 1, max = 100)
    private String name;    // 名称

    @Length(min = 0, max = 2000)
    private String href;    // 链接
    private Integer sort;    // 排序

    @Pattern(regexp = "1|0")
    private String isShow = "0";    // 是否在菜单中显示（1：显示；0：不显示）
    private String permission; // 权限标识

    @JsonIgnore
    private String userId;

    public Menu() {
        super();
    }

    public Menu(String id) {
        super(id);
    }

    public Menu getParent() {
        return parent;
    }

    public void setParent(Menu parent) {
        this.parent = parent;
    }

    public String getParentIds() {
        return parentIds;
    }

    public void setParentIds(String parentIds) {
        this.parentIds = parentIds;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getIsShow() {
        return isShow;
    }

    public void setIsShow(String isShow) {
        this.isShow = isShow;
    }

    public String getPermission() {
        return permission;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "Menu [parent=" + parent + ", parentIds=" + parentIds + ", name=" + name + ", href=" + href + ", sort="
                + sort + ", isShow=" + isShow + ", permission=" + permission + ", userId=" + userId + "]";
    }


}
